﻿using System;
using Summer.Web;
using WebIocDemo.Services;

namespace WebIocDemo
{
    public partial class _Default : System.Web.UI.Page
    {
        public DateTimeMakerService Time { get; set; }
        public NumberMakerService Number { get; set; }
        public DateTimeMakerService TimeNumber { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            var a=this.GetBaseContainer();
            var b = (DateTimeMakerService)this.GetDefaultContextObject("dateTimeMaker");
            var c = b.Create();
            var d = this.GetDefaultContextObject("testRef");
            Response.Write("BaseContainer is "+a + "<br/>");
            Response.Write("DateTimeMakerService is " + b + "<br/>");
            Response.Write("DateTimeMakerService getter is " + c + "<br/>");
            Response.Write("OtherService is " + d.GetType() + "<br/>");
            Response.Write("Dynamic Service:DateTimeMakerService.Time is " + Time.Create());
            Response.Write("<br/>");
            Response.Write("Static Service:NumberMakerService.Number is " + Number.Create());
            Response.Write("<br/>");
            Response.Write("Property Service:DateTimeMakerService.String is " + TimeNumber.Test());
        }
    }
}
